.class public Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;
.super Lcom/waiqin365/lightapp/base/WqBaseActivity;

# interfaces
.implements Landroid/view/View$OnClickListener;
.implements Landroid/widget/AdapterView$OnItemClickListener;


# instance fields
.field private a:Landroid/widget/ImageView;

.field private b:Landroid/widget/TextView;

.field private c:Landroid/widget/ListView;

.field private d:Lcom/waiqin365/lightapp/photo/a/c;

.field private e:Ljava/util/List;

.field private f:Lcom/waiqin365/lightapp/b/c;


# direct methods
.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Lcom/waiqin365/lightapp/base/WqBaseActivity;-><init>()V

    return-void
.end method

.method private a()V
    .locals 5

    const/4 v1, 0x0

    invoke-virtual {p0}, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    const-string/jumbo v2, "picType"

    invoke-virtual {v0, v2}, Landroid/content/Intent;->getSerializableExtra(Ljava/lang/String;)Ljava/io/Serializable;

    move-result-object v0

    check-cast v0, Lcom/waiqin365/lightapp/b/c;

    iput-object v0, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->f:Lcom/waiqin365/lightapp/b/c;

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->e:Ljava/util/List;

    invoke-static {}, Lcom/waiqin365/base/login/mainview/a;->a()Lcom/waiqin365/base/login/mainview/a;

    move-result-object v0

    invoke-virtual {v0, p0}, Lcom/waiqin365/base/login/mainview/a;->b(Landroid/content/Context;)Ljava/util/HashMap;

    move-result-object v0

    const-string/jumbo v2, "volpicup"

    invoke-virtual {v0, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/HashMap;

    if-eqz v0, :cond_2

    :try_start_0
    new-instance v2, Lcom/waiqin365/lightapp/b/c;

    invoke-direct {v2}, Lcom/waiqin365/lightapp/b/c;-><init>()V

    const-string/jumbo v3, "0"

    iput-object v3, v2, Lcom/waiqin365/lightapp/b/c;->a:Ljava/lang/String;

    const v3, 0x7f0805b2

    invoke-virtual {p0, v3}, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->getString(I)Ljava/lang/String;

    move-result-object v3

    iput-object v3, v2, Lcom/waiqin365/lightapp/b/c;->b:Ljava/lang/String;

    iget-object v3, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->f:Lcom/waiqin365/lightapp/b/c;

    if-eqz v3, :cond_0

    iget-object v3, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->f:Lcom/waiqin365/lightapp/b/c;

    iget-object v3, v3, Lcom/waiqin365/lightapp/b/c;->a:Ljava/lang/String;

    if-eqz v3, :cond_0

    const-string/jumbo v3, ""

    iget-object v4, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->f:Lcom/waiqin365/lightapp/b/c;

    iget-object v4, v4, Lcom/waiqin365/lightapp/b/c;->a:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_1

    :cond_0
    const/4 v3, 0x1

    iput-boolean v3, v2, Lcom/waiqin365/lightapp/b/c;->c:Z

    :goto_0
    iget-object v3, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->e:Ljava/util/List;

    invoke-interface {v3, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    new-instance v2, Lorg/json/JSONArray;

    const-string/jumbo v3, "pic_type_data"

    invoke-virtual {v0, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-direct {v2, v0}, Lorg/json/JSONArray;-><init>(Ljava/lang/String;)V

    move v0, v1

    :goto_1
    invoke-virtual {v2}, Lorg/json/JSONArray;->length()I

    move-result v1

    if-ge v0, v1, :cond_2

    new-instance v1, Lcom/waiqin365/lightapp/b/c;

    invoke-direct {v1}, Lcom/waiqin365/lightapp/b/c;-><init>()V

    invoke-virtual {v2, v0}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v3

    const-string/jumbo v4, "id"

    invoke-virtual {v3, v4}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    iput-object v4, v1, Lcom/waiqin365/lightapp/b/c;->a:Ljava/lang/String;

    const-string/jumbo v4, "name"

    invoke-virtual {v3, v4}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    iput-object v3, v1, Lcom/waiqin365/lightapp/b/c;->b:Ljava/lang/String;

    iget-object v3, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->f:Lcom/waiqin365/lightapp/b/c;

    if-eqz v3, :cond_3

    iget-object v3, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->f:Lcom/waiqin365/lightapp/b/c;

    iget-object v3, v3, Lcom/waiqin365/lightapp/b/c;->b:Ljava/lang/String;

    if-eqz v3, :cond_3

    iget-object v3, v1, Lcom/waiqin365/lightapp/b/c;->a:Ljava/lang/String;

    iget-object v4, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->f:Lcom/waiqin365/lightapp/b/c;

    iget-object v4, v4, Lcom/waiqin365/lightapp/b/c;->a:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_3

    const/4 v3, 0x1

    iput-boolean v3, v1, Lcom/waiqin365/lightapp/b/c;->c:Z

    :goto_2
    iget-object v3, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->e:Ljava/util/List;

    invoke-interface {v3, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    add-int/lit8 v0, v0, 0x1

    goto :goto_1

    :cond_1
    const/4 v3, 0x0

    iput-boolean v3, v2, Lcom/waiqin365/lightapp/b/c;->c:Z
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    :cond_2
    return-void

    :cond_3
    const/4 v3, 0x0

    :try_start_1
    iput-boolean v3, v1, Lcom/waiqin365/lightapp/b/c;->c:Z
    :try_end_1
    .catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_2
.end method

.method private a(Landroid/content/Intent;)V
    .locals 3

    new-instance v0, Lcom/waiqin365/lightapp/view/a/a;

    invoke-direct {v0}, Lcom/waiqin365/lightapp/view/a/a;-><init>()V

    invoke-virtual {p0}, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->getIntent()Landroid/content/Intent;

    move-result-object v1

    const-string/jumbo v2, "returnTo"

    invoke-virtual {v1, v2}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, v0, Lcom/waiqin365/lightapp/view/a/a;->a:Ljava/lang/String;

    iput-object p1, v0, Lcom/waiqin365/lightapp/view/a/a;->b:Ljava/lang/Object;

    invoke-static {}, Lcom/waiqin365/lightapp/view/a/b;->a()Ljava/util/Observable;

    move-result-object v1

    invoke-virtual {v1, v0}, Ljava/util/Observable;->notifyObservers(Ljava/lang/Object;)V

    invoke-virtual {p0}, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->back()V

    return-void
.end method

.method private b()V
    .locals 2

    const v0, 0x7f0c0991

    invoke-virtual {p0, v0}, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    iput-object v0, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->a:Landroid/widget/ImageView;

    const v0, 0x7f0c0993

    invoke-virtual {p0, v0}, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->b:Landroid/widget/TextView;

    iget-object v0, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->b:Landroid/widget/TextView;

    const v1, 0x7f080639

    invoke-virtual {p0, v1}, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    new-instance v0, Lcom/waiqin365/lightapp/photo/a/c;

    iget-object v1, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->e:Ljava/util/List;

    invoke-direct {v0, p0, v1}, Lcom/waiqin365/lightapp/photo/a/c;-><init>(Landroid/content/Context;Ljava/util/List;)V

    iput-object v0, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->d:Lcom/waiqin365/lightapp/photo/a/c;

    const v0, 0x7f0c099a

    invoke-virtual {p0, v0}, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ListView;

    iput-object v0, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->c:Landroid/widget/ListView;

    iget-object v0, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->c:Landroid/widget/ListView;

    iget-object v1, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->d:Lcom/waiqin365/lightapp/photo/a/c;

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    iget-object v0, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->c:Landroid/widget/ListView;

    invoke-virtual {v0, p0}, Landroid/widget/ListView;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V

    return-void
.end method

.method private c()V
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->a:Landroid/widget/ImageView;

    invoke-virtual {v0, p0}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    return-void
.end method


# virtual methods
.method public onBackPressed()V
    .locals 1

    const/4 v0, 0x0

    invoke-direct {p0, v0}, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->a(Landroid/content/Intent;)V

    return-void
.end method

.method public onClick(Landroid/view/View;)V
    .locals 1

    invoke-virtual {p1}, Landroid/view/View;->getId()I

    move-result v0

    packed-switch v0, :pswitch_data_0

    :goto_0
    return-void

    :pswitch_0
    const/4 v0, 0x0

    invoke-direct {p0, v0}, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->a(Landroid/content/Intent;)V

    goto :goto_0

    nop

    :pswitch_data_0
    .packed-switch 0x7f0c0991
        :pswitch_0
    .end packed-switch
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 1

    invoke-super {p0, p1}, Lcom/waiqin365/lightapp/base/WqBaseActivity;->onCreate(Landroid/os/Bundle;)V

    invoke-static {p0}, Lcom/fiberhome/gaea/client/d/a;->b(Landroid/app/Activity;)V

    const v0, 0x7f0301c2

    invoke-virtual {p0, v0}, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->setContentView(I)V

    invoke-direct {p0}, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->a()V

    invoke-direct {p0}, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->b()V

    invoke-direct {p0}, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->c()V

    return-void
.end method

.method public onItemClick(Landroid/widget/AdapterView;Landroid/view/View;IJ)V
    .locals 3

    const/4 v2, 0x0

    iget-object v0, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->e:Ljava/util/List;

    invoke-interface {v0, p3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/waiqin365/lightapp/b/c;

    iput-object v0, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->f:Lcom/waiqin365/lightapp/b/c;

    move v1, v2

    :goto_0
    iget-object v0, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->e:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-ge v1, v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->e:Ljava/util/List;

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/waiqin365/lightapp/b/c;

    iput-boolean v2, v0, Lcom/waiqin365/lightapp/b/c;->c:Z

    add-int/lit8 v0, v1, 0x1

    move v1, v0

    goto :goto_0

    :cond_0
    iget-object v0, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->f:Lcom/waiqin365/lightapp/b/c;

    const/4 v1, 0x1

    iput-boolean v1, v0, Lcom/waiqin365/lightapp/b/c;->c:Z

    iget-object v0, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->e:Ljava/util/List;

    iget-object v1, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->f:Lcom/waiqin365/lightapp/b/c;

    invoke-interface {v0, p3, v1}, Ljava/util/List;->set(ILjava/lang/Object;)Ljava/lang/Object;

    iget-object v0, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->d:Lcom/waiqin365/lightapp/photo/a/c;

    invoke-virtual {v0}, Lcom/waiqin365/lightapp/photo/a/c;->notifyDataSetChanged()V

    new-instance v0, Landroid/content/Intent;

    invoke-direct {v0}, Landroid/content/Intent;-><init>()V

    const-string/jumbo v1, "picType"

    iget-object v2, p0, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->f:Lcom/waiqin365/lightapp/b/c;

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/io/Serializable;)Landroid/content/Intent;

    const/4 v1, -0x1

    invoke-virtual {p0, v1, v0}, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->setResult(ILandroid/content/Intent;)V

    invoke-direct {p0, v0}, Lcom/waiqin365/lightapp/photo/PhotoTypeSelectActivity;->a(Landroid/content/Intent;)V

    return-void
.end method
